package com.xiaohe66.web.infrastructure.mybatis.sys.sec.convert;

import com.xiaohe66.web.domain.sys.sec.agg.SecEncrypt;
import com.xiaohe66.web.domain.sys.sec.value.SecEncryptId;
import com.xiaohe66.web.domain.sys.sec.value.SecEncryptPublicKey;
import com.xiaohe66.web.infrastructure.domain.adapter.DataConverter;
import com.xiaohe66.web.infrastructure.mybatis.sys.sec.model.SecEncryptDo;
import com.xiaohe66.web.integration.DoConverter;
import org.mapstruct.Mapper;

/**
 * @author xiaohe
 * @since 2024-01-03 11:30
 */
@Mapper(componentModel = "spring")
public interface SecEncryptDoConverter extends DoConverter<SecEncrypt, SecEncryptDo>, DataConverter {

    default SecEncryptId newValue(Long value) {
        return ifPresent(value, SecEncryptId::new);
    }

    default SecEncryptPublicKey newValue(String value) {
        return ifPresent(value, SecEncryptPublicKey::new);
    }

}
